﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

<script type="text/javascript">

</script>

<div>
    <p>
        <input id="statuslist" type="hidden" value="all"/>
        <label><b><%=ViewData["SearchType"] %> :</b></label>
        <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <input id="searchTitle" type="text" size="60" maxlength="30" />

        <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <input id="btnSearch" value="Tìm kiếm" class="button" type="button" onclick="search(1)" />

        <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <input id="btnViewAll" value="Xem tất cả" class="button" type="button" onclick="viewAll(1)" />
        
        <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
        <input id="btnEdit" value="Chỉnh sửa" class="button" type="button" onclick="javascript:window.location='/QuanLyNoiDung/SuaMenu/<%=ViewData["ContentType"]%>'" />
    </p>
    </div>
    <script type="text/javascript">
        function search(pageindex) {
            $("#statuslist").val("search");
            var contentType = '<%=ViewData["ContentType"]%>';

            $.get("/QuanLyNoiDung/DanhSachTapTin/" + contentType + "?strPageIndex=" + pageindex + "&qTitle=" + $("#searchTitle").val(),
                function (data) {
                    $('#news-list').fadeOut();
                    $('#news-list').html(data);
                    $('#news-list').fadeIn();
                }
            );
        }

        function viewAll(pageindex) {
            $("#statuslist").val("all");
            $("#searchTitle").val("");
            var contentType = '<%=ViewData["ContentType"]%>';

            $.get("/QuanLyNoiDung/DanhSachTapTin/" + contentType + "?strPageIndex=" + pageindex + "&qTitle=" + $("#searchTitle").val(),
                function(data) {
                    $('#news-list').fadeOut();
                    $('#news-list').html(data);
                    $('#news-list').fadeIn();
                }
            );
        }

    </script>